package hlhj.fhp.checkpoint.presenter

import android.content.Context
import com.example.mymvp.mvp.BasePresenter
import hlhj.fhp.checkpoint.iview.InitView
import hlhj.fhp.checkpoint.javaBean.MEBean
import hlhj.fhp.checkpoint.module.InitModule
import hlhj.fhp.checkpoint.utils.SPHelper

/**
 * Created by Never Fear   on 2018\11\13 0013.
Never More....
 */
class InitPresenter :BasePresenter<InitModule,InitView>(), InitView {
    override fun createModule() {
        module=InitModule()
        module.listener=this
    }

    override fun judgeLogin(isLogined: Boolean) {

    }
    fun checkImei(imei:String,c:Context){
        module?.checkMe(imei, c)
    }
    override fun setMe(meBean: MEBean) {
        view?.setMe(meBean)
    }

    fun isLogin(c:Context){
        if (SPHelper.getToken(c)?.equals("")!!){
            view?.judgeLogin(false)
        }else{
            view?.judgeLogin(true)
        }
    }
}